import request from '@/utils/request';
import { data } from 'autoprefixer';

// 获取文本详情
export function getTextset() {
    return request({
        url: '/platform/text/list?pageSize=10&pageNum=1',
        method: 'get'
    })
}

//修改文本
export interface text {
    /*** 唯一标识*/
    code: string;
    /*** 平台详情*/
    content: any;
    /*** ID*/
    id?: string;
    /*** 状态*/
    status: string;
    /*** 标题*/
    title: string;
    [property: string]: any;
}
export function modifyText(data: text) {
    return request({
        url: '/platform/text/edit',
        method: 'put',
        data: data
    })
}


//获取标签
export function getLabel() {
    return request({
        url: '/system/label/list?pageSize=10&pageNum=1',
        method: 'get'
    })
}

// 添加标签

export interface label {
    /*** 是否可用*/
    enable?: string;
    /*** id*/
    id: string;
    /*** 标签名*/
    label?: string;
    [property: string]: any;
}
export function modifyLabel(data: label) {
    return request({
        url: '/system/label',
        method: 'put',
        data: data
    })
}

export interface labelAdd {
    /**
     * 标签名
     */
    label: string;
    [property: string]: any;
}
export function addLabelTitle(data: labelAdd) {
    return request({
        url: '/system/label',
        method: 'post',
        data: data
    })
}

// 删除标签
export interface ids {
    ids: string;
    [property: string]: any;
}
export function delLabel(ids: ids) {
    return request({
        url: `/system/label/${ids}`,
        method: 'delete'
    })
}

// 获取栏目
export function getColumn() {
    return request({
        url: '/system/category/list?pageSize=10&pageNum=1',
        method: 'get'
    })
}

// 新增栏目
export interface category {
    /**
     * 分类名
     */
    name?: string;
    /**
     * 排序
     */
    sort?: string;
    [property: string]: any;
}
export function addColumn(data:category) {
    return request({
        url: '/system/category',
        method: 'post',
        data: data
    })
}

// 修改栏目
export interface editColumn {
    /**
     * 是否可用
     */
    enable: string;
    /**
     * 分类id
     */
    id: string;
    /**
     * 分类名
     */
    name: string;
    /**
     * 排序关键字
     */
    sort: string;
    [property: string]: any;
}
export function editColumn(data: editColumn){
    return request({
        url: '/system/category',
        method: 'put',
        data: data
    })
}


// 删除成功
export function delColumn(ids: ids){
    return request({
        url: `/system/category/${ids}`,
        method: 'delete',
    })
}


//请求轮播图
export function getSlide() {
    return request({
        url: '/slideshow/list?pageSize=10&pageNum=1',
        method: 'get'
    })
}

// 删除
export function delSlide(ids:ids) {
    return request({
        url: '/slideshow/delete',
        method: 'delete',
        params: ids
    })
}
